﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Marmat.Template.WinForm
{
    /// <summary>
    /// 基于对象的单据命令接口扩展。
    /// </summary>
    /// <typeparam name="Entity"></typeparam>
    /// <typeparam name="DataSource"></typeparam>
    public interface IDocumentCommandPagination<Entity, DataSource> : IDocumentCommandBase<Entity, DataSource>
    {
        /// <summary>
        /// 按条件加载。
        /// </summary>
        /// <param name="condition">条件</param>
        /// <param name="page">页号</param>
        /// <param name="top">行数</param>
        /// <param name="order">排序</param>
        /// <param name="count">返回行数</param>
        /// <returns></returns>
        DataSource Load(string condition, int page, int top, string order, out int count);
    }

    /// <summary>
    /// 基于 System.Data.DataTable 的单据命令接口扩展。
    /// </summary>
    public interface IDocumentCommandPagination : IDocumentCommandPagination<System.Data.DataRow, System.Data.DataTable>, IDocumentCommandBase
    {
    }

    /// <summary>
    /// 基于 System.Data.DataTable 的单据命令接口扩展。
    /// </summary>
    public interface IDocumentCommandPagination<Entity> : IDocumentCommandPagination<Entity, Entity[]>,IDocumentCommandBase<Entity>
    {
    }
}
